<template>
    <div class="container">
        <!-- 条件 -->
        <div class="querydiv" shadow="never">
            <el-form  size="medium" label-width="100px">
                <el-row :span="24">
                    <el-col :span="5">
                        <el-form-item label="当前分支名称">
                            <el-input  v-model="inForm.branchName" placeholder="当前分支名称"></el-input>
                        </el-form-item>
                        <el-form-item label="当前分支编号">
                            <el-input  v-model="inForm.branchCode" placeholder="当前分支编号"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="4" class="disflex spacecenter align-center" style="height:90px">
                        <el-image fit="cover" style="width:130px;height:34px" :src="require('@/assets/arrow.png')" />
                    </el-col>
                    <el-col :span="5">
                        <el-form-item label="合并分支名称">
                            <el-input  v-model="inForm.toBranchName" placeholder="合并分支名称"></el-input>
                        </el-form-item>
                        <el-form-item label="合并分支编号">
                            <el-input  v-model="inForm.toBranchCode" placeholder="合并分支编号"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="合并备注" class="pdleft20">
                            <el-input  v-model="inForm.toRemarks" :autosize="{ minRows: 4, maxRows: 4}" type="textarea" placeholder="合并备注"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>

        <el-card class="box-card mt15">
            <div slot="header" class="spacebetween disflex align-center">
                <span style="color:#000;font-size:16px;font-weight:700">{{this.action}}</span>
                <el-checkbox v-model="checked">只看变动内容</el-checkbox>
            </div>
            <el-row :gutter="20">
                <el-col :span="12">
                    <el-table :data="itemlist" :header-cell-style="{background:'#e4ebfd',color:'#7690db'}">
                        <el-table-column align="center" prop="toDrgCode"  label="调整前" ></el-table-column>
                        <el-table-column align="center" prop="toDrgName"  label="" ></el-table-column>
                    </el-table>
                </el-col>
                <el-col :span="12">
                    <el-table :data="itemlist" :header-cell-style="{background:'#e4ebfd',color:'#7690db'}">
                        <el-table-column align="center" prop="drgCode"  label="调整后" ></el-table-column>
                        <el-table-column align="center" prop="drgName"  label="" ></el-table-column>
                        <el-table-column align="center" fixed="right"  label="">
                            <template slot-scope="scope">
                                <!-- <el-button type="text"  class="edit" @click="handlInfo(scope.row)">查看</el-button> -->
                                <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
                                    <el-checkbox :key="scope.row.id" :label="scope.row.id">可以</el-checkbox>
                                </el-checkbox-group>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <el-row class="mt15 disflex pd-x20 spacecenter">
                <el-button type="primary" class="btn btncolor" size="medium" @click="onSubmitme">确定通过</el-button>
                <el-button  >取消</el-button>
            </el-row>
        </el-card>
    </div>
</template>

<script>
import { adrgpage,drgpage,mccpage,mdcpage,groupage,excluepage,mlistpage } from '@/api/manager.js'
export default {
    data(){
        return{
            inForm:{},
            id:this.$route.query.id,
            changeFlag:this.$route.query.changeFlag,
            itemlist:[],
            action:this.$route.query.action,
            checkedCities:[],
            checked:false
        }
    },
    created(){
        if(this.action == 'adrg'){
            this.getadrgpage()
        }else if(this.action == 'drg'){
            this.getdrgpage()
        }else if(this.action == 'exclude'){
            this.getExclu()
        }else if(this.action == 'list'){
            this.getmlistpage()
        }else if(this.action == 'mcc_cc'){
            this.getmccpage()
        }else if(this.action == 'mdc'){
            this.getmdcpage()
        }else{
            this.getgroupage()
        }
    },
    methods:{

        // 分页查询ADRG信息
        getadrgpage(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                adrgpage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },
        // 分页查询DRG信息
        getdrgpage(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                drgpage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },
        // 分页查询MccCc信息
        getmccpage(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                mccpage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },
        // 分页查询Mdc信息
        getmdcpage(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                mdcpage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },

        // 分页查询不做分组规则信息
        getgroupage(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                groupage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },
        // 分页查询Exclue排除信息
        getExclu(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                excluepage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },
        // 2.分页查询集合表信息
        getmlistpage(){
            let forms = {
                page:1,
                num:10,
                id:this.id,
                changeFlag:this.changeFlag
            }
            this.$getFlag().then(obj=>{
                mlistpage(forms,obj.data).then(res=>{
                    if(res.status == 200){
                        this.itemlist = res.list
                    }
                })
            })
        },
        handleCheckedCitiesChange(){
            console.log(this.checkedCities)
        },
        onSubmitme(){

        }
    }
}
</script>
